package com.wl.index.web;

import jakarta.servlet.http.HttpServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

//index首页是帖子内容 + 评论管理 + 内容推荐
@RestController
public class IndexDo {
    @RequestMapping("index")
    public String index(HttpServletRequest request) {
        return "index " + request.getServerPort();//RequestMapping + 端口
    }

    @Autowired
    RestTemplate restTemplate;
    @RequestMapping("index-other")
    String other(){
        return restTemplate.getForObject("http://lv-other/other", String.class);
    }
}
